#ifndef PID_BALENCE_H_
#define PID_BALENCE_H_

//include
#include "zf_common_typedef.h"
#include "motor_driver.h"
#include "pid.h"


typedef enum {
    plane_normal,
    plane_jump,
    plane_bridge,
} plane_balence_mode;

typedef enum {
    steering_normal,
    steering_danbianqiao,
    steering_chuhuandao,
    steering_guizhong,
    steering_barrier_first,
    steering_barrier_second,
    steering_barrier_third,
    steering_stop,
    steering_jump
} steering_mode;

typedef enum {
    leg_normal,
    leg_danbianqiao,
    leg_jump,
    leg_yawan,
} leg_mode;

struct pid_balence_leg_s
{
    float angle;   /* data */
    float length;
};

struct pid_balence_mode_s
{
    plane_balence_mode plane;
    steering_mode steering;
    leg_mode leg;
};

struct pid_balence_s
{
    struct pid_balence_mode_s mode;
    torque plane_balence_torque;   /* data */
    torque steering_torque;
    struct pid_balence_leg_s left_leg;
    struct pid_balence_leg_s right_leg;
};
extern struct PID_parameters pid_loc_v_angle;
extern struct PID_parameters pid_loc_a_angle;
extern struct PID_parameters pid_inc_v_avarage;
extern struct PID_parameters pid_loc_yaw_angle;
extern struct PID_parameters pid_inc_roll_angle;

extern struct pid_balence_s pid_balence;
extern uint8 jump_fangxiang;
void dynamic_pid_balence(void);
void dynamic_pid_balence_init(void);

#endif
